/**
 * Copyright (c) 2000-2012 Liferay, Inc. All rights reserved.
 *
 * This library is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Lesser General Public License as published by the Free
 * Software Foundation; either version 2.1 of the License, or (at your option)
 * any later version.
 *
 * This library is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
 * details.
 */

package com.hotel.test.model.impl;

import com.hotel.test.model.RomType;

import com.liferay.portal.kernel.util.StringBundler;
import com.liferay.portal.kernel.util.StringPool;
import com.liferay.portal.model.CacheModel;

import java.io.Serializable;

import java.util.Date;

/**
 * The cache model class for representing RomType in entity cache.
 *
 * @author Vien-IT
 * @see RomType
 * @generated
 */
public class RomTypeCacheModel implements CacheModel<RomType>, Serializable {
	@Override
	public String toString() {
		StringBundler sb = new StringBundler(23);

		sb.append("{romId=");
		sb.append(romId);
		sb.append(", userId=");
		sb.append(userId);
		sb.append(", userName=");
		sb.append(userName);
		sb.append(", createDate=");
		sb.append(createDate);
		sb.append(", modifiedDate=");
		sb.append(modifiedDate);
		sb.append(", roomName=");
		sb.append(roomName);
		sb.append(", information=");
		sb.append(information);
		sb.append(", numberOfGuest=");
		sb.append(numberOfGuest);
		sb.append(", rice=");
		sb.append(rice);
		sb.append(", numberOfRoom=");
		sb.append(numberOfRoom);
		sb.append(", hotelId=");
		sb.append(hotelId);
		sb.append("}");

		return sb.toString();
	}

	public RomType toEntityModel() {
		RomTypeImpl romTypeImpl = new RomTypeImpl();

		romTypeImpl.setRomId(romId);
		romTypeImpl.setUserId(userId);

		if (userName == null) {
			romTypeImpl.setUserName(StringPool.BLANK);
		}
		else {
			romTypeImpl.setUserName(userName);
		}

		if (createDate == Long.MIN_VALUE) {
			romTypeImpl.setCreateDate(null);
		}
		else {
			romTypeImpl.setCreateDate(new Date(createDate));
		}

		if (modifiedDate == Long.MIN_VALUE) {
			romTypeImpl.setModifiedDate(null);
		}
		else {
			romTypeImpl.setModifiedDate(new Date(modifiedDate));
		}

		if (roomName == null) {
			romTypeImpl.setRoomName(StringPool.BLANK);
		}
		else {
			romTypeImpl.setRoomName(roomName);
		}

		if (information == null) {
			romTypeImpl.setInformation(StringPool.BLANK);
		}
		else {
			romTypeImpl.setInformation(information);
		}

		romTypeImpl.setNumberOfGuest(numberOfGuest);

		if (rice == null) {
			romTypeImpl.setRice(StringPool.BLANK);
		}
		else {
			romTypeImpl.setRice(rice);
		}

		romTypeImpl.setNumberOfRoom(numberOfRoom);
		romTypeImpl.setHotelId(hotelId);

		romTypeImpl.resetOriginalValues();

		return romTypeImpl;
	}

	public long romId;
	public long userId;
	public String userName;
	public long createDate;
	public long modifiedDate;
	public String roomName;
	public String information;
	public int numberOfGuest;
	public String rice;
	public int numberOfRoom;
	public long hotelId;
}